﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ServiceProcess;

namespace ZLCMS.Web.Example
{
    public partial class GlobalSessionValue : System.Web.UI.Page
    {
        ServiceController _controller;

        protected void Page_Load(object sender, EventArgs e)
        {
            _controller = new ServiceController("aspnet_state");

            Label1.Text = _controller.Status.ToString();
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (_controller.Status != ServiceControllerStatus.Running)
            {
                _controller.Start();
                _controller.Refresh();
            }
            Label1.Text = _controller.Status.ToString();
        }
    }
}
